package com.hyzx.qbasic.common.util;

import org.bson.types.ObjectId;

import java.util.UUID;

/**
 * Created by 黄江华 on 2017/9/21
 */

public class UuidUtils {

    /**
     * 使用MongoDB的ObjectId作为全局唯一ID生成器
     */
    public static String getObjectId() {
        return ObjectId.get().toString();
    }

    public static String getUuid() {
        return UUID.randomUUID().toString();
    }

    public static String get32Uuid() {
        String uuid = UUID.randomUUID().toString().replaceAll("-", "");
        return uuid;
    }
}
